﻿using System;
using System.Collections.Generic;
using Shoy.Utility.Extend;

namespace HelloService
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var action = "action".Query(string.Empty);
            switch (action)
            {
                case "info":
                    GetInfo();
                    break;
            }
        }

        private void GetInfo()
        {
            var cache = Consts.GetCache();
            var list = cache.Get(Consts.MessageCacheKey) ?? new List<string>();
            Response.Clear();
            Response.ContentType = "application/json";
            Response.Write(list.ToJson());
            cache.Remove(Consts.MessageCacheKey);
            Response.End();
        }
    }
}